package cn.tedu.jsd2210.csmall.product.mapper;

import cn.tedu.jsd2210.csmall.product.pojo.entity.Category;
import cn.tedu.jsd2210.csmall.product.pojo.vo.CategoryListItemVO;
import cn.tedu.jsd2210.csmall.product.pojo.vo.CategoryStandardVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 *
 * @author Don
 * @version 0.0.1
 */
@Repository
public interface CategoryMapper {

    int insert(Category category);


    int insertBatch(List<Category> categories);


    int deleteById(Long id);


    int deleteByIds(Long[] ids);

    int update(Category category);

    int count();

    int countByName(String name);

    int countByNameAndNotId(@Param("name")String name,@Param("id")Long id);

    int countByParentId(Long parentId);



    CategoryStandardVO getStandardById(Long id);

    List<CategoryListItemVO> list();

    List<CategoryListItemVO> listByParentId(Long parentId);



}
